#include "amever.h"

/* when the */ 
int mob_sees_char (struct world_mob *mob, struct world_char *wchar) {
	/* It cries and runs for help O_O */
	if (mob->target == 0 && DISTANCEC(mob->cell, wchar->cell) <= 9) {
		/* Lock on it */
		mob->target = wchar->position;
		//Position is a chain_node in cell->objects set, which moves when char does.
		printf("Locked on %d:%d\n", CELL(mob->target)->X, CELL(mob->target)->Y);
	}
}


/*
int mob_do (struct world_mob *mob) {
	if (mob->status.dead || mob->lazy)
		return 0;
	if (mob->target != 0) {
		mob_trytogetto((struct world_cell *)mob->target.val);
	}
}

int mob_trytogetto(struct world_mob *mob, struct world_cell *cell) {
	if (!mob || !*mob)
		return 0;
	if (DISTANCEP(mob->cell, cell) > mob->status.view_radius)
		return 0;
}

int mob_random_walk(struct world_mob *mob) {
	
}
*/
